package com.keti.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.keti.Dao.UserDao;
import com.keti.DaoImpl.UserDaoImpl;
import com.keti.pojo.User;


/**
 * Servlet implementation class ToUpdataUserservlet
 */
@WebServlet("/ToUpdataUserservlet")
public class ToUpdataUserservlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		UserDao ud = new UserDaoImpl();
		int id = Integer.parseInt(request.getParameter("id"));
		User u = null;
		u = ud.queryOne(id);
		request.setAttribute("u",u);
		request.getRequestDispatcher("jsp/user/Updata.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
